<?php
class IndexController extends Zend_Controller_Action{
	
	public function init(){
		//echo $this->_request->getModuleName();
	}
	
	public function indexAction(){
		$this->forward('index','product','default');
	}
    
	public function aboutusAction(){
		$this->view->layout()->placeholders = array(
				'slider'=>array('status'=>false,'content'=>""),
				'search'=>array('status'=>false,'content'=>"")
		);
		$mdConstant = new Application_Model_DbTable_Constant();
		$row = $mdConstant->fetchRow($mdConstant->select()->where('constant_code = ?','default_about_us'));
		$this->view->row=$row;
	}
    
    public function contactAction(){
        $this->view->layout()->placeholders = array(
				'slider'=>array('status'=>false,'content'=>""),
				'search'=>array('status'=>false,'content'=>"")
		);
        $form = new Default_Form_Contact();        
        $mdConstant = new Application_Model_DbTable_Constant();
        $row = $mdConstant->fetchRow($mdConstant->select()->where('constant_code = ?','default_contact'));
        if($this->_request->isPost()){
    	       if($form->isValid($_POST)){
    	          
    	       }
               
    	   }
    	$this->view->row=$row;        
        $this->view->form = $form;
    }
	
	public function testAction(){
		$this->_helper->layout()->disableLayout(true);
		$mdUser = new Application_Model_DbTable_User();
		$user = $mdUser->fetchAll()->toArray();
		//$this->_helper->json->sendJson($user);
		echo json_encode($user);
	}
	
	public function test2Action(){
	//$this->_helper->layout()->disableLayout(true);
	}
}